﻿#region Imports
using System.Drawing;
using System.Windows.Controls;
using System.Windows;
using CheckerWPF.Utils;
#endregion

namespace CheckerWPF.UserControls
{
    /// <summary>
    /// Interaction logic for RadioButtonAligned.xaml
    /// </summary>
    public partial class RadioButtonAligned : BaseUserControl
    {
        #region Constructor
        public RadioButtonAligned()
        {
            InitializeComponent();

            CheckAlign = ContentAlignment.MiddleLeft;
            OptionChecked = true;
        }
        #endregion

        #region Properties
        public ContentAlignment CheckAlign
        {
            get { return (ContentAlignment)GetValue(checkAlignProperty); }
            set { SetValue(checkAlignProperty, value); }
        }

        // Using a DependencyProperty as the backing store for CheckAlign.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty checkAlignProperty =
            DependencyProperty.Register("CheckAlign", typeof(ContentAlignment), typeof(RadioButtonAligned), new UIPropertyMetadata(ContentAlignment.MiddleLeft));

        public string OptionText
        {
            set { radOption.Content = value; }
        }

        public bool OptionChecked
        {
            get { return (bool)GetValue(OptionCheckedProperty); }
            set
            {
                SetValue(OptionCheckedProperty, value);
                radOption.IsChecked = value;
            }
        }

        // Using a DependencyProperty as the backing store for OptionChecked.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty OptionCheckedProperty =
            DependencyProperty.Register("OptionChecked", typeof(bool), typeof(RadioButtonAligned), new UIPropertyMetadata(false));
        #endregion
    }
}
